@extends('mainlayout')

@section('title','欢迎来到mall商城')

@section('username',$username)

@section('css')
    @parent
@endsection

@section('contents')

    <!--首页的轮播图-->
    <section class="flat-row flat-slider">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <div class="slider owl-carousel">
                        <!-- 轮播图1 -->
                        <div class="slider-item style2">
                            <div class="item-text">
                                <div class="header-item">
                                    <p>Enhanced Technology</p>
                                    <h2 class="name">{{$sliderInfo[0][0]}}</h2>
                                </div>
                                <div class="divider65"></div>
                                <div class="content-item">
                                    <div class="price">
                                        <span class="sale">￥{{$sliderInfo[0][1]}}</span>
                                        <span class="btn-shop">
												<a href="#" title="">立即抢购<img src="{{asset('images/icons/right-2.png')}}" alt=""></a>
											</span>
                                        <div class="clearfix"></div>
                                    </div>
                                    <div class="regular">
                                        原价折扣
                                    </div>
                                </div>
                            </div>
                            <div class="item-image">
                                <div class="sale-off">
                                    60 % <span>sale</span>
                                </div>
                                <img src="{{asset($sliderInfo[0][2])}}" alt="">
                            </div>
                            <div class="clearfix"></div>
                        </div><!-- /.slider -->
                        <!-- 轮播图2 -->
                        <div class="slider-item style2">
                            <div class="item-text">
                                <div class="header-item">
                                    <p>Enhanced Technology</p>
                                    <h2 class="name">{{$sliderInfo[1][0]}}</h2>
                                </div>
                                <div class="divider65"></div>
                                <div class="content-item">
                                    <div class="price">
                                        <span class="sale">￥{{$sliderInfo[1][1]}}</span>
                                        <span class="btn-shop">
												<a href="#" title="">立即抢购<img src="{{asset('images/icons/right-2.png')}}" alt=""></a>
											</span>
                                        <div class="clearfix"></div>
                                    </div>
                                    <div class="regular">
                                        原价折扣
                                    </div>
                                </div>
                            </div>
                            <div class="item-image">
                                <img src="{{asset($sliderInfo[1][2])}}" alt="">
                            </div>
                            <div class="clearfix"></div>
                        </div><!-- /.slider -->
                        <!-- 轮播图3 -->
                        <div class="slider-item style2">
                            <div class="item-text">
                                <div class="header-item">
                                    <p>Enhanced Technology</p>
                                    <h2 class="name">{{$sliderInfo[2][0]}}</h2>
                                </div>
                                <div class="divider65"></div>
                                <div class="content-item">
                                    <div class="price">
                                        <span class="sale">￥{{$sliderInfo[2][1]}}</span>
                                        <span class="btn-shop">
												<a href="#" title="">立即抢购<img src="{{asset('images/icons/right-2.png')}}" alt=""></a>
											</span>
                                        <div class="clearfix"></div>
                                    </div>
                                    <div class="regular">
                                        原价折扣
                                    </div>
                                </div>
                            </div>
                            <div class="item-image">
                                <div class="sale-off">
                                    60 % <span>sale</span>
                                </div>
                                <img src="{{asset($sliderInfo[2][2])}}" alt="">
                            </div>
                            <div class="clearfix"></div>
                        </div><!-- /.slider -->
                    </div><!-- /.slider -->
                </div><!-- /.col-md-12 -->
            </div><!-- /.row -->
        </div><!-- /.container -->
    </section><!-- /.flat-slider -->

    <!--首页的产品列表-->
    <section class="flat-imagebox">
        <div class="container">
            <!-- 商品列表字样 -->
            <div class="row">
                <div class="col-md-12">
                    <div class="product-tab">
                        <ul class="tab-list">
                            <li class="active">商品列表</li>
                        </ul>
                    </div><!-- /.product-tab -->
                </div><!-- /.col-md-12 -->
            </div><!-- /.row -->

            <div class="box-product">
                <div class="row">
                    <!--一个产品  对这个div进行循环即可-->
                    @foreach($productsInfo as $item)
                    <div class="col-lg-3 col-sm-6">
                        <div class="product-box">
                            <div class="imagebox">
                                <ul class="box-image owl-carousel-1">
                                    <li>
                                        <a href="{{url('proDetails',['products_id'=>$item->id])}}" title="">
                                            <img src="{{asset($item->previewfile)}}" alt="">
                                        </a>
                                    </li>
                                    <li>
                                        <a href="{{url('proDetails',['products_id'=>$item->id])}}" title="">
                                            <img src="{{asset($item->previewfile)}}" alt="">
                                        </a>
                                    </li>
                                    <li>
                                        <a href="{{url('proDetails',['products_id'=>$item->id])}}" title="">
                                            <img src="{{asset($item->previewfile)}}" alt="">
                                        </a>
                                    </li>
                                </ul><!-- /.box-image -->
                                <div class="box-content">
                                    <div class="cat-name">
                                        <a href="" title="">{{$item->catename}}</a>
                                    </div>
                                    <div class="product-name">
                                        <a href="{{url('proDetails',['products_id'=>$item->id])}}" title="">{{$item->name}}<br />{{$item->summary}}</a>
                                    </div>
                                    <div class="price">
                                        <span class="sale">￥{{$item->price}}</span>
                                    </div>
                                </div><!-- /.box-content -->
                            </div><!-- /.imagebox -->
                        </div>
                    </div><!-- /.col-lg-3 col-sm-6 -->
                    @endforeach
                </div><!-- /.row -->
            </div><!-- /.box-product -->
        </div><!-- /.container -->
    </section><!-- /.flat-imagebox -->

@endsection



@section('js')
    @parent
@endsection
